Optimal. Leaf size=40 \[ -\frac{(c+d x) \tanh (e+f x)}{f}+c x+\frac{d \log (\cosh (e+f x))}{f^2}+\frac{d x^2}{2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.031248, antiderivative size = 40, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3720, 3475} \[ -\frac{(c+d x) \tanh (e+f x)}{f}+c x+\frac{d \log (\cosh (e+f x))}{f^2}+\frac{d x^2}{2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3720
Rule 3475
Rubi steps
\begin{align*} \int (c+d x) \tanh ^2(e+f x) \, dx &=-\frac{(c+d x) \tanh (e+f x)}{f}+\frac{d \int \tanh (e+f x) \, dx}{f}+\int (c+d x) \, dx\\ &=c x+\frac{d x^2}{2}+\frac{d \log (\cosh (e+f x))}{f^2}-\frac{(c+d x) \tanh (e+f x)}{f}\\ \end{align*}
Mathematica [A] time = 0.236924, size = 77, normalized size = 1.92 \[ \frac{c \tanh ^{-1}(\tanh (e+f x))}{f}-\frac{c \tanh (e+f x)}{f}+\frac{d \log (\cosh (e+f x))}{f^2}-\frac{d x \text{sech}(e) \sinh (f x) \text{sech}(e+f x)}{f}+\frac{d x \text{sech}(e) (f x \cosh (e)-2 \sinh (e))}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.031, size = 65, normalized size = 1.6 \begin{align*}{\frac{d{x}^{2}}{2}}+cx-2\,{\frac{dx}{f}}-2\,{\frac{de}{{f}^{2}}}+2\,{\frac{dx+c}{f \left ({{\rm e}^{2\,fx+2\,e}}+1 \right ) }}+{\frac{d\ln \left ({{\rm e}^{2\,fx+2\,e}}+1 \right ) }{{f}^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.19629, size = 171, normalized size = 4.28 \begin{align*} c{\left (x + \frac{e}{f} - \frac{2}{f{\left (e^{\left (-2 \, f x - 2 \, e\right )} + 1\right )}}\right )} - \frac{1}{2} \, d{\left (\frac{2 \, x e^{\left (2 \, f x + 2 \, e\right )}}{f e^{\left (2 \, f x + 2 \, e\right )} + f} - \frac{f x^{2} +{\left (f x^{2} e^{\left (2 \, e\right )} - 2 \, x e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{f e^{\left (2 \, f x + 2 \, e\right )} + f} - \frac{2 \, \log \left ({\left (e^{\left (2 \, f x + 2 \, e\right )} + 1\right )} e^{\left (-2 \, e\right )}\right )}{f^{2}}\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.6038, size = 578, normalized size = 14.45 \begin{align*} \frac{d f^{2} x^{2} + 2 \, c f^{2} x +{\left (d f^{2} x^{2} + 2 \,{\left (c f^{2} - 2 \, d f\right )} x\right )} \cosh \left (f x + e\right )^{2} + 2 \,{\left (d f^{2} x^{2} + 2 \,{\left (c f^{2} - 2 \, d f\right )} x\right )} \cosh \left (f x + e\right ) \sinh \left (f x + e\right ) +{\left (d f^{2} x^{2} + 2 \,{\left (c f^{2} - 2 \, d f\right )} x\right )} \sinh \left (f x + e\right )^{2} + 4 \, c f + 2 \,{\left (d \cosh \left (f x + e\right )^{2} + 2 \, d \cosh \left (f x + e\right ) \sinh \left (f x + e\right ) + d \sinh \left (f x + e\right )^{2} + d\right )} \log \left (\frac{2 \, \cosh \left (f x + e\right )}{\cosh \left (f x + e\right ) - \sinh \left (f x + e\right )}\right )}{2 \,{\left (f^{2} \cosh \left (f x + e\right )^{2} + 2 \, f^{2} \cosh \left (f x + e\right ) \sinh \left (f x + e\right ) + f^{2} \sinh \left (f x + e\right )^{2} + f^{2}\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.307424, size = 66, normalized size = 1.65 \begin{align*} \begin{cases} c x - \frac{c \tanh{\left (e + f x \right )}}{f} + \frac{d x^{2}}{2} - \frac{d x \tanh{\left (e + f x \right )}}{f} + \frac{d x}{f} - \frac{d \log{\left (\tanh{\left (e + f x \right )} + 1 \right )}}{f^{2}} & \text{for}\: f \neq 0 \\\left (c x + \frac{d x^{2}}{2}\right ) \tanh ^{2}{\left (e \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.3522, size = 181, normalized size = 4.52 \begin{align*} \frac{d f^{2} x^{2} e^{\left (2 \, f x + 2 \, e\right )} + d f^{2} x^{2} + 2 \, c f^{2} x e^{\left (2 \, f x + 2 \, e\right )} + 2 \, c f^{2} x - 4 \, d f x e^{\left (2 \, f x + 2 \, e\right )} + 2 \, d e^{\left (2 \, f x + 2 \, e\right )} \log \left (e^{\left (2 \, f x + 2 \, e\right )} + 1\right ) + 4 \, c f + 2 \, d \log \left (e^{\left (2 \, f x + 2 \, e\right )} + 1\right )}{2 \,{\left (f^{2} e^{\left (2 \, f x + 2 \, e\right )} + f^{2}\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]